@push('title')
    <title>恒博去哪库存政策修改</title>
@endpush
@push("style2")
    <style>
        form .split-text {
            float: left;
            line-height: 50px;
            font-size: 16px;
            font-weight: 500;
            text-align: left;
            position: absolute;
            left: 40px;
            color: #555;
            margin-bottom: 16px;
            padding-left: 123px;
        }

        form .split-text-f {
            margin-top: -25px;
            padding-top: 20px;
            padding-left: 90px;
        }

        form .split-text-c {
            padding-top: 32px;
        }

        form .split-text-price {
            padding-top: 32px;
            padding-left: 90px;
            font-size: 14px;
            margin-bottom: 16px;
        }

        form .split-text-returnChange {
            padding-top: 35px;
            padding-left: 50px;
            font-size: 14px;
            margin-bottom: 16px;
        }

        .layui-form-item {
            margin-left: 100px;
            margin-bottom: 10px;
        }

        form .layui-form-item .layui-inline{
            margin-right: -90px;
        }

        form .signChange {
            float: left;
            width: 95px;
            padding: 9px 0px;
            text-align: left;
        }

        form .cabinDes {
            margin-top: 15px;
            /*margin-left: 130px;*/
        }

        .layui-form-label {
            width: 130px;
        }

        /* 底部边框 */
        .input-bottom {
            border: none;
            border-bottom: 1px dashed #e6e6e6;
            outline: none;
            color: #9d9d9d;
            background: none;
        }

        input[disabled] {
            background-color: transparent;
            color: inherit; /* 保持文字颜色不变 */
            cursor: not-allowed; /* 设置鼠标指针为禁止点击状态 */
        }

        .layui-form-mid {
            color: #9d9d9d;
        }

        .layui-textarea, .layui-input {

            border-radius: 4px !important;
            height: 34px;
        }


        .layui-textarea {
            width: 800px;
            height: 120px;
            padding: 23px;
        }

        .piece-f {
            margin-bottom: 16px;
            padding-top: 74px;
        }

        .piece {
            margin-bottom: 16px;
            padding-top: 32px;
        }

        .pata-item {
            display: none;
        }

        .back-item {
            display: none;
        }

        .flight {
            background: none;
            color: #1976d2;
            border: solid 1px #1976d2;
            height: 30px;
            line-height: 30px;
            padding: 0 15px;
        }

        .ant-form-explain {
            clear: both;
            color: rgba(0, 0, 0, .45);
            font-size: 14px;
            line-height: 1.5;
            margin-top: -2px;
            margin-left: 160px;
            min-height: 22px;
            transition: color .3s cubic-bezier(.215, .61, .355, 1);
        }
        .layui-input[disabled] {
            background-color: #f5f5f5;
        }

        .ant-card-bordered {
            border: 1px solid #e8e8e8;
        }
        .ant-card {
            font-feature-settings: "tnum";
            background: #fff;
            border-radius: 2px;
            box-sizing: border-box;
            color: rgba(0, 0, 0, .65);
            font-size: 14px;
            font-variant: tabular-nums;
            line-height: 1.5;
            list-style: none;
            margin: 0;
            padding: 0;
            position: relative;
            transition: all .3s;
        }

        .ant-card-body {
            zoom: 1;
            padding: 24px;
        }

        .layui-input-group > .layui-input-suffix {
            width: 10px;
        }
    </style>
@endpush
@extends('layout.layer')
@section('content')

    <form class="layui-form" action="#" lay-filter="first">
        <input type="hidden" name="_token" value="{{csrf_token()}}">
        <input type="hidden" name="platform" value="31">
        <input type="hidden" name="id" value="{{$policy['id']}}">
        <input type="hidden" name="policyId" value="{{$policy['policyId']}}">
        <input type="hidden" name="policyDetailId" value="{{$policy['detail']['id']}}">

        <div class="split-text split-text-f">新增库存政策</div>
        <div class="split-text split-text-c">基本信息</div>
        <div class="layui-form-item"></div>
        <div class="piece-f">
            <div class="layui-form-item">
                <label class="layui-form-label">航程类型:</label>
                <div class="layui-input-inline" style="width: 405px">
                    <div class="layui-form-mid" style="width: 170px;padding: 9px 0px;color: #333">单程</div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">政策代码:</label>
                <div class="layui-input-inline">
                    <input type="text" name="policycode" value="{{$policy['policy_code']}}" lay-verify="required" lay-reqText="" placeholder=""
                           autocomplete="off" class="layui-input" style="width: 370px">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">政策有效性:</label>
                <div class="layui-input-inline" lay-filter="status" style="width: 370px">
                    <select name="status">
                        <option value="删除" @if($policy['status'] == '-1') selected @endif>删除</option>
                        <option value="挂起" @if($policy['status'] == '0') selected @endif>挂起</option>
                        <option value="有效" @if($policy['status'] == '1') selected @endif>有效</option>
                        <option value="失效" @if($policy['status'] == '2') selected @endif>失效</option>
                        <option value="待确认" @if($policy['status'] == '3') selected @endif>待确认</option>
                    </select>
                </div>
            </div>

        </div>
        <hr>
        <div class="split-text">航班信息</div>
        <div class="layui-form-item"></div>
        <div class="piece">
            <div class="layui-form-item">
                <label class="layui-form-label layui-required">航空公司:</label>
                <div class="layui-input-inline">
                    <input type="text" id="AirLine" name="flightcode" value="{{$policy['airline']}}" lay-verify="required" maxlength="2" lay-reqText="航空公司不能为空"
                           lay-filter="flightcode" placeholder="" autocomplete="off" class="layui-input" style="width: 385px">
                </div>
                <div class="ant-form-explain">
                    航司二字码，必须大写字母，仅允许录入一个航司，例如：CA
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">主飞航司:</label>
                <div class="layui-input-inline">
                    <input type="text"  id="mainAirline" name="actCarrier" value="{{$policy['detail']['act_carrier']}}" lay-verify="" lay-reqText="" lay-filter="mainAirline" placeholder="" autocomplete="off" class="layui-input"
                           style="width: 420px">
                </div>
                <div class="ant-form-explain">
                    如果选择共享验主飞，则仅能录入一个，否则可录入多个，用“,”分隔
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">出发机场:</label>
                <div class="layui-input-inline">
                    <input type="text" name="dpt" value="{{$policy['depart_city_code']}}" id="depart_code" lay-verify="required" maxlength="3" lay-verify="" lay-reqText="出发机场不能为空"
                           lay-filter="dpt" placeholder="" autocomplete="off" class="layui-input" style="width: 365px">
                </div>
                <div class="ant-form-explain">支持*、单个机场三字码，例如：*或PEK</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">到达机场:</label>
                <div class="layui-input-inline">
                    <input type="text" name="arr" value="{{$policy['arrived_city_code']}}" id="arrived_code" lay-verify="required" lay-verify="" lay-reqText="到达机场不能为空"
                           lay-filter="arr" placeholder="" autocomplete="off" class="layui-input" style="width: 365px">
                </div>
                <div class="ant-form-explain">
                    支持*、单个或多个机场三字码，例如：PEK,SHA
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">适用仓位:</label>
                <div class="layui-input-inline">
                    <input type="text" name="cabin" value="{{$policy['cabin']}}" id="applyCabin" lay-verify="required" lay-reqText="适用仓位不能为空"
                           lay-filter="cabin" placeholder="" autocomplete="off" class="layui-input" style="width: 536px">
                </div>
                <div class="ant-form-explain">
                    录入*代表覆盖到全部舱位，多个舱位不需要分隔符，指定票面时不能为*。如：FCXM1
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">不适用仓位:</label>
                <div class="layui-input-inline">
                    <input type="text" name="forbidCabin" value="{{$policy['detail']['no_cabin']}}" id="noApplyCabin" lay-verify="" lay-reqText=""
                           lay-filter="forbidCabin" placeholder="" autocomplete="off" class="layui-input" style="width: 365px">
                </div>
                <div class="ant-form-explain">多个舱位不需要分隔符，如：FCXM1</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">航班号限制:</label>
                <div class="layui-input-inline" style="width: 300px">
                    <select name="flightNoLimit" lay-filter="flightNoLimit">
                        <option value="所有" @if($policy['detail']['flight_no_limit'] == '所有') selected @endif>所有</option>
                        <option value="适用" @if($policy['detail']['flight_no_limit'] == '适用') selected @endif>适用</option>
                        <option value="不适用" @if($policy['detail']['flight_no_limit'] == '不适用') selected @endif>不适用</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item" id="FlightLimitConditionDiv" style="display: block;">
                <label class="layui-form-label layui-required">航班号限制条件:</label>
                <div class="layui-input-inline" lay-filter="flightcondition" style="width: 670px">
                    <input type="text" name="flightcondition" value="{{$policy['detail']['flight_condition']}}" lay-verify="" lay-reqText="航班号限制条件不能为空" autocomplete="off" class="layui-input">
                </div>
                <div class="ant-form-explain">
                    支持录入多个航班与航班范围，范围之间用“-”链接，多个航班之间用“,”分隔，单个航班需要在航班范围前录入
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">支持共享航班:</label>
                <div class="layui-input-block">
                    <input type="radio" name="shared" value="是" title="是" @if($policy['detail']['shared'] == '是') checked @endif lay-filter="shared">
                    <input type="radio" name="shared" value="否" title="否" @if($policy['detail']['shared'] == '否') checked @endif lay-filter="shared">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">支持经停航班:</label>
                <div class="layui-input-block">
                    <input type="radio" name="stop" value="是" @if($policy['detail']['stop'] == '是') checked @endif title="全部" lay-filter="stop">
                    <input type="radio" name="stop" value="是" @if($policy['detail']['stop'] == '是') checked @endif title="经停" lay-filter="stop">
                    <input type="radio" name="stop" value="否" @if($policy['detail']['stop'] == '否') checked @endif title="非经停" lay-filter="stop">
                </div>
            </div>

            <!--去程-->
            <div class="layui-form-item">
                <span class="go-item"><label class="layui-form-label layui-required">有效起飞航班日期:</label></span>
                <div class="layui-input-inline" id="flight-date" style="width: 500px;">
                    <div class="layui-input-inline layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-date"></i>
                        </div>
                        <input type="text" name="startdate" value="{{$policy['depart_at']}}" autocomplete="off" id="flight-start"
                               lay-verify="required|title" class="layui-input" placeholder="开始日期">
                    </div>
                    <div class="layui-form-mid">-</div>
                    <div class="layui-input-inline layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-date"></i>
                        </div>
                        <input type="text" name="enddate" value="{{$policy['detail']['arrived_at']}}" autocomplete="off" id="flight-end"
                               lay-verify="required|title" class="layui-input" placeholder="结束日期">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">无效航班起飞日期:</label>
                <div class="layui-input-inline" style="width: 408px">
                    <input type="text" name="dptDateForbid" value="{{$policy['detail']['depart_date_forbid']}}" lay-verify="" lay-reqText="" autocomplete="off"
                           class="layui-input">
                </div>
                <div class="ant-form-explain">
                    支持录入多段，多段之间用“,”分隔，举例：2021-12-15/2021-12-31,2022-01-07/2022-01-13
                </div>
            </div>

            <div class="layui-form-item">
                <span class="go-item"><label class="layui-form-label">航班起飞时间段:</label></span>
                <div class="layui-input-inline" style="width: 485px">
                    <input type="text" name="depttimeslot" value="{{$policy['detail']['depart_time_slot']}}" lay-verify="" lay-reqText="" autocomplete="off"
                           class="layui-input">
                </div>
                <div class="ant-form-explain">HHMM-HHMM，如2040-2359，至多录入3段航班起飞时间，中间用逗号隔开</div>
            </div>

            <div class="layui-form-item">
                <span class="go-item"><label class="layui-form-label layui-required">航班班期限制:</label></span>
                <div class="layui-input-inline" id="DaysFDiv" style="width: 500px" lay-verify="" lay-reqText="请选择航班班期限制">
                    <input type="checkbox" name="dayCondition[]" lay-filter="dayCondition" value="1" title="周一" @if(strpos(' '.$policy['detail']['day_condition'],'1')) checked @endif>
                    <input type="checkbox" name="dayCondition[]" lay-filter="dayCondition" value="2" title="周二" @if(strpos(' '.$policy['detail']['day_condition'],'2')) checked @endif>
                    <input type="checkbox" name="dayCondition[]" lay-filter="dayCondition" value="3" title="周三" @if(strpos(' '.$policy['detail']['day_condition'],'3')) checked @endif>
                    <input type="checkbox" name="dayCondition[]" lay-filter="dayCondition" value="4" title="周四" @if(strpos(' '.$policy['detail']['day_condition'],'4')) checked @endif>
                    <input type="checkbox" name="dayCondition[]" lay-filter="dayCondition" value="5" title="周五" @if(strpos(' '.$policy['detail']['day_condition'],'5')) checked @endif>
                    <input type="checkbox" name="dayCondition[]" lay-filter="dayCondition" value="6" title="周六" @if(strpos(' '.$policy['detail']['day_condition'],'6')) checked @endif>
                    <input type="checkbox" name="dayCondition[]" lay-filter="dayCondition" value="7" title="周日" @if(strpos(' '.$policy['detail']['day_condition'],'7')) checked @endif>
                </div>
                <div class="layui-form-mid"><a href="#" id="flight-week-all" style="color: #1976d2"> 全选 </a>&nbsp;&nbsp;<a
                            href="#" id="flight-week-invert" style="color: #1976d2">反选</a></div>
                <div id="DaysCheck" class="ant-form-explain" style="display: none; color: red;" >请选择航班班期限制</div>
            </div>

            <div class="layui-form-item">
                <span class="go-item"><label class="layui-form-label">不适用航线:</label></span>
                <div class="layui-input-inline" style="width: 515px">
                    <input type="text" name="forbidAirlines" value="{{$policy['detail']['forbid_airlines']}}" lay-verify="" lay-reqText="" autocomplete="off"
                           class="layui-input">
                </div>
                <div class="ant-form-explain">多个航线用","分隔，最多支持录入600个航线；例如：PEK-SHA,CTU-HAK,*-XMH</div>
            </div>
        </div>
        <hr>
        <div class="split-text">销售规则</div>
        <div class="layui-form-item"></div>
        <div class="piece">
            <div class="layui-form-item">
                <label class="layui-form-label layui-required">产品类型:</label>
                <div class="layui-input-inline" id="noAirline" style="width: 405px">
                    <div class="layui-form-label" style="width: 120px;padding: 9px 0px">请先输入航空公司</div>
                </div>

                <div class="layui-input-inline" id="HaveAirline" style="width: 500px; display: none;" lay-filter="" lay-verify="required" lay-reqText="请选择产品类型">
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="500" title="标品 (500)" @if(in_array(500,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="222" title="标品-高频人群 (222)" @if(in_array(222,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="228" title="标品-复购特惠 (228)" @if(in_array(228,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="-1" title="定向套餐 (-1)" @if(in_array(-1,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="201" title="旅行套餐 (201)" @if(in_array(201,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="221" title="旅行套餐-高频人群 (221)" @if(in_array(221,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="223" title="旅行套餐-高频年龄22-60岁 (223)" @if(in_array(223,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="227" title="旅行套餐-复购特惠 (227)" @if(in_array(227,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="280" title="机酒套餐 (280)" @if(in_array(280,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="894" title="早鸟套餐 (894)" @if(in_array(894,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="514" title="年龄特惠3-28岁 (514)" @if(in_array(514,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="497" title="年龄特惠12-22岁及55岁以上 (497)" @if(in_array(497,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="504" title="年龄特惠13-23岁及55岁以上 (504)" @if(in_array(504,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="501" title="年龄特惠18-22岁及55岁以上 (501)" @if(in_array(501,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="891" title="青年特惠13-22岁 (891)" @if(in_array(891,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="505" title="青年特惠18-22岁 (505)" @if(in_array(505,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="431" title="青年特惠18-24岁 (431)" @if(in_array(431,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="503" title="年龄特惠16-24岁及50岁以上 (503)" @if(in_array(503,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="574" title="老年特惠60-100岁 (574)"@if(in_array(574,$policy['detail']['product_mark'])) checked @endif >
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="493" title="2-9人小团 (493)" @if(in_array(493,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="502" title="3-9人小团 (502)" @if(in_array(502,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="266" title="直采产品 (266)" @if(in_array(266,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="265" title="直采产品 (265)" @if(in_array(265,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="210" title="单程包机切位 (210)" @if(in_array(210,$policy['detail']['product_mark'])) checked @endif>
                    <input type="checkbox" name="productMark[]" lay-filter="productMark" value="1057" title="年龄限制55-100 (1057)" @if(in_array(1057,$policy['detail']['product_mark'])) checked @endif>
                </div>
                <div class="ant-form-explain">tips：鼠标移入产品可查看产品说明；支持选择多个</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-required">销售日期:</label>
                <div class="layui-input-inline" id="sale-date" style="width: 500px;">
                    <div class="layui-input-inline layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-date"></i>
                        </div>
                        <input type="text" name="saledatestart" value="{{$policy['detail']['sale_start_at']}}" autocomplete="off" id="sale-start"
                               lay-verify="required|title" class="layui-input" placeholder="开始日期">
                    </div>
                    <div class="layui-form-mid">-</div>
                    <div class="layui-input-inline  layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-date"></i>
                        </div>
                        <input type="text" name="saledateend" value="{{$policy['detail']['sale_end_at']}}" autocomplete="off" id="sale-end"
                               lay-verify="required|title" class="layui-input" placeholder="结束日期">
                    </div>
                </div>
                <div class="ant-form-explain">必填，当天截止销售的政策，24点之后不显示</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">禁止销售日期:</label>
                <div class="layui-input-inline" id="stop-sale-date" style="width: 500px;">
                    <div class="layui-input-inline layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-date"></i>
                        </div>
                        <input type="text" name="saleDateForbidStart" value="{{$policy['detail']['sale_forbid_start_at']}}" autocomplete="off" id="stop-sale-start"
                               class="layui-input" placeholder="开始日期">
                    </div>
                    <div class="layui-form-mid">-</div>
                    <div class="layui-input-inline  layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-date"></i>
                        </div>
                        <input type="text" name="saleDateForbidEnd" value="{{$policy['detail']['sale_forbid_end_at']}}" autocomplete="off" id="stop-sale-end"
                               class="layui-input" placeholder="结束日期">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">销售时间段:</label>
                <div class="layui-input-inline" style="width: 456px">
                    <input type="text" name="saleTimeSlot" value="{{$policy['detail']['sale_time_slot']}}" lay-verify="" lay-reqText=""
                           placeholder="" autocomplete="off" class="layui-input">
                </div>
                <div class="ant-form-explain">
                    HHMM-HHMM，如2040-2359，至多录入3段销售时间，中间用逗号隔开
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">起飞前截止销售时间:</label>
                <div class="layui-input-inline layui-input-group" style="width: 450px">
                    <input type="text" name="lockTime" value="{{$policy['detail']['lock_time']}}" lay-verify="number" lay-reqText="" placeholder=""
                           autocomplete="off" class="layui-input">
                    <div class="layui-input-split layui-input-suffix">
                        分钟
                    </div>
                </div>
                <div class="ant-form-explain">
                    起飞前MM分钟停止销售，时间仅支持输入正整数，范围在60(包含)～180(包含)，不填默认120。超出范围，按边界值计算
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">最早提前出票时限:</label>
                <div class="layui-input-inline layui-input-group" style="width: 450px">
                    <input type="text" name="earliestBeforeTicket" value="{{$policy['detail']['earliest_before_ticket']}}" lay-verify="number" lay-reqText="" placeholder=""
                           autocomplete="off" class="layui-input">
                    <div class="layui-input-split layui-input-suffix">
                        天
                    </div>
                </div>
                <div class="ant-form-explain">含当天，输入正整数有效。例如：最早出票时限为5，用户至多提前5天预订机票</div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">最晚提前出票时限:</label>
                <div class="layui-input-inline layui-input-group" style="width: 510px">
                    <input type="text" name="beforeTicket" value="{{$policy['detail']['before_ticket']}}" lay-verify="number" lay-reqText="" placeholder=""
                           autocomplete="off" class="layui-input">
                    <div class="layui-input-split layui-input-suffix">
                        天
                    </div>
                </div>
                <div class="ant-form-explain">含当天，输入正整数有效。例如：最晚出票时限为2，用户至少提前2天预订机票</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">证件类型:</label>
                <div class="layui-input-block">
                    <input type="radio" name="cardtype" value="0" title="所有证件" @if($policy['detail']['card_type'] == '0') checked @endif lay-filter="cardtype">
                </div>
            </div>
        </div>
        <hr>
        <div class="split-text">价格结算及校验</div>
        <div class="layui-form-item"></div>
        <div class="split-text split-text-price">票面价</div>
        <div class="piece">
            <div class="layui-form-item"><label class="layui-form-label"></label></div>
            <div class="layui-form-item"><label class="layui-form-label"></label></div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-required">运价类型:</label>
                <div class="layui-input-inline" style="width: 370px">
                    <select name="printsource" lay-filter="printsource">
                        <option value="公布运价" @if($policy['detail']['print_source'] == '私有运价') selected @endif>公布运价</option>
                        <option value="私有运价" @if($policy['detail']['print_source'] == '私有运价') selected @endif>私有运价</option>
                        <option value="直减运价" @if($policy['detail']['print_source'] == '直减运价') selected @endif>直减运价</option>
                        <option value="指定票面价" @if($policy['detail']['print_source'] == '指定票面价') selected @endif>指定票面价</option>
                        <option value="旗舰店价格" @if($policy['detail']['print_source'] == '旗舰店价格') selected @endif>旗舰店价格</option>
                    </select>
                </div>
                <div class="ant-form-explain" id="PriceRuleTip">
                    FD运价；以平台运价为准
                </div>
            </div>

            <div class="layui-form-item" id="CalculationFaceValueDiv">
                <label class="layui-form-label layui-required">公式计算票面价类型:</label>
                <div class="layui-input-inline" style="width: 370px">
                    <select name="printComputeType" lay-filter="printComputeType">
                        <option value="公式计算票面价(适用舱位)" @if($policy['detail']['print_compute_type'] == '公式计算票面价(适用舱位)') selected @endif>公式计算票面价(适用舱位)</option>
                        <option value="公式计算票面价(订座舱位)" @if($policy['detail']['print_compute_type'] == '公式计算票面价(订座舱位)') selected @endif>公式计算票面价(订座舱位)</option>
                    </select>
                </div>
                <div class="ant-form-explain" id="formula">
                    Y*(1-a)+b,其中Y、a、b分别为计算票面价的适用舱位、票面价返点和票面价留钱
                </div>
            </div>

            <div class="layui-form-item" id="XCabinDiv" style="display: none;">
                <label class="layui-form-label layui-required">X代表舱位:</label>
                <div class="layui-input-inline" lay-filter="xCabin" style="width: 370px">
                    <input type="text" name="xCabin" value="{{$policy['detail']['x_cabin']}}" lay-verify="" lay-reqText="X代表舱位不能为空" placeholder=""
                           autocomplete="off" class="layui-input">
                </div>
                <div class="ant-form-explain">
                    大写英文字母或大写英文字母+数字，仅支持一个舱位录入
                </div>
            </div>

            <div class="layui-form-item" id="CabinSelPriceDiv" style="display: none;">
                <label class="layui-form-label layui-required">舱位取价:</label>
                <div class="layui-input-inline" lay-filter="selectType" style="width: 370px">
                    <select name="selectType" lay-verify="" lay-reqText="舱位取价不能为空">
                        <option value="取低" @if($policy['detail']['select_type'] == '取低') selected @endif>取低</option>
                        <option value="取高" @if($policy['detail']['select_type'] == '取高') selected @endif>>取高</option>
                    </select>
                </div>
            </div>

            <div id="FaceValue">
                <div class="layui-form-item" id="FaceValueBackDiv">
                    <label class="layui-form-label">票面价返点:</label>
                    <div class="layui-input-inline layui-input-group" lay-filter="FaceValueBack" style="width: 370px">
                        <input type="text" id="FaceValueBack" disabled="true" name="printReturnPoint" value="{{$policy['detail']['print_return_point']}}"
                               lay-verify="number" lay-reqText="" placeholder="" autocomplete="off" class="layui-input">
                        <div class="layui-input-split layui-input-suffix">
                            %
                        </div>
                    </div>
                    <div class="ant-form-explain">范围-100到200 最多支持两位小数，支持正负，默认为0</div>
                </div>

                <div class="layui-form-item" id="FaceValueKeepDiv">
                    <label class="layui-form-label">票面价留钱:</label>
                    <div class="layui-input-inline" lay-filter="FaceValueKeep" style="width: 370px">
                        <input type="text" id="FaceValueKeep" disabled="true" name="printReturnPrice" value="{{$policy['detail']['print_return_price']}}"
                               lay-verify="number" lay-reqText="" placeholder=""
                               autocomplete="off" class="layui-input">
                    </div>
                    <div class="ant-form-explain">支持正负整数输入</div>
                </div>

                <div class="layui-form-item" id="FaceValueIntDiv">
                    <label class="layui-form-label layui-required">票面价取整:</label>
                    <div class="layui-input-inline" lay-filter="" style="width: 370px">
                        <select name="xPriceType" lay-filter="xPriceType">
                            <option value="十位四舍五入" @if($policy['detail']['x_price_type'] == '十位四舍五入') selected @endif>十位四舍五入</option>
                            <option value="十位五舍六入" @if($policy['detail']['x_price_type'] == '十位五舍六入') selected @endif>十位五舍六入</option>
                            <option value="十位向上取整" @if($policy['detail']['x_price_type'] == '十位向上取整') selected @endif>十位向上取整</option>
                            <option value="十位向下取整" @if($policy['detail']['x_price_type'] == '十位向下取整') selected @endif>十位向下取整</option>
                            <option value="个位向下取整" @if($policy['detail']['x_price_type'] == '个位向下取整') selected @endif>个位向下取整</option>
                            <option value="个位向上取整" @if($policy['detail']['x_price_type'] == '个位向上取整') selected @endif>个位向上取整</option>
                            <option value="个位四舍五入" @if($policy['detail']['x_price_type'] == '个位四舍五入') selected @endif>个位四舍五入</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item" id="MinFaceValueDiv">
                    <label class="layui-form-label">最低票面价:</label>
                    <div class="layui-input-inline" lay-filter="minPrintPrice" style="width: 370px">
                        <input type="text" name="minPrintPrice" value="{{$policy['detail']['min_print_price']}}" lay-verify="number" lay-reqText=""
                               placeholder=""
                               autocomplete="off" class="layui-input">
                    </div>
                    <div class="ant-form-explain">选填，录入正整数有效，低于最低票面价不展示</div>
                </div>

                <div class="layui-form-item" id="MaxFaceValueDiv">
                    <label class="layui-form-label">最高票面价:</label>
                    <div class="layui-input-inline" lay-filter="maxPrintPrice" style="width: 370px">
                        <input type="text" name="maxPrintPrice" value="{{$policy['detail']['max_print_price']}}" lay-verify="number" lay-reqText=""
                               placeholder=""
                               autocomplete="off" class="layui-input">
                    </div>
                    <div class="ant-form-explain">选填，录入正整数有效，高于最高票面价不展示</div>
                </div>
            </div>
            <div class="layui-form-item" id="DesignationFaceValueDiv" style="display: none;">
                <label class="layui-form-label layui-required">指定票面价:</label>
                <div class="layui-input-inline" lay-filter="printprice" style="width: 370px">
                    <input type="text" name="printprice" value="{{$policy['price']}}" lay-verify="" lay-reqText="指定票面价不能为空" placeholder=""
                           autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>

        <div class="split-text split-text-price">政策价</div>
        <div class="layui-form-item"><label class="layui-form-label"></label></div>
        <div class="piece">
            <div class="layui-form-item"><label class="layui-form-label"></label></div>

            <div class="layui-form-item">
                <label class="layui-form-label">政策价返点:</label>
                <div class="layui-input-inline layui-input-group" lay-filter="" style="width: 370px">
                    <input type="text" name="policyReturnPoint" value="{{$policy['detail']['policy_return_point']}}"
                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" lay-verify=""
                           lay-reqText="" placeholder="" autocomplete="off" class="layui-input">
                    <div class="layui-input-split layui-input-suffix">
                        %
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">政策价留钱:</label>
                <div class="layui-input-inline" lay-filter="policyReturnPrice" style="width: 370px">
                    <input type="text" name="policyReturnPrice" value="{{$policy['detail']['policy_return_price']}}"
                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,1})?).*$/g, '$1')" lay-verify=""
                           lay-reqText="" placeholder="" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">固定追价阈:</label>
                <div class="layui-input-inline" lay-filter="autoPriceThreshold" style="width: 370px">
                    <input type="text" name="autoPriceThreshold" value="{{$policy['detail']['auto_price_threshold']}}"
                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,1})?).*$/g, '$1')" lay-verify=""
                           lay-reqText="" placeholder="" autocomplete="off" class="layui-input">
                </div>
                <div class="ant-form-explain">选填，支持录入一位小数，按录入的金额进行追价</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">百分比追价阈值:</label>
                <div class="layui-input-inline layui-input-group" lay-filter="percentPriceThreshold"
                     style="width: 370px">
                    <input type="text" name="percentPriceThreshold" value="{{$policy['detail']['percent_price_threshold']}}" lay-verify="" lay-reqText=""
                           placeholder="" autocomplete="off" class="layui-input">
                    <div class="layui-input-split layui-input-suffix">
                        %
                    </div>
                </div>
                <div class="ant-form-explain">
                    <p>选填，支持0-100之间的两位小数数字录入，精确到
                        <br>两位小数（系统根据票面价*追价百分比自动计算追价
                        <br>阈值，精确到小数后一位，向下取整；当固定追价阈
                        <br>值和百分比追价阈值同时有值时，实际追价阈值取两者
                        <br>之和进行计算）
                    </p>
                </div>
            </div>
        </div>

        <div class="split-text split-text-price">校验</div>
        <div class="layui-form-item"><label class="layui-form-label"></label></div>
        <div class="piece">
            <div class="layui-form-item"><label class="layui-form-label"></label></div>

            <div class="layui-form-item">
                <label class="layui-form-label">预订Office号:</label>
                <div class="layui-input-block">
                    <input type="radio" name="preOfficeNo" value="" title="不限" @if(empty($policy['detail']['pre_office_no'])) checked @endif>
                    <input type="radio" name="preOfficeNo" value="CGO134" @if(!empty($policy['detail']['pre_office_no']) && $policy['detail']['pre_office_no'] == 'CGO134') checked @endif title="CGO134">
                </div>
                <div class="ant-form-explain">
                    从在线PID列表中匹配适用的office
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-required">是否生成PNR:</label>
                <div class="layui-input-inline" style="width: 620px">
                    <input type="radio" name="needPnr" lay-filter="needPnr" value="是" title="是">
                    <input type="radio" name="needPnr" lay-filter="needPnr" value="否" title="否" checked>
                </div>
                <div class="ant-form-explain">
                    必选，不生成PNR也会进行AV校验，请确保投放配置有AV及封口权限，舱位开放，该政策才会生效
                </div>
            </div>
            <div class="layui-form-item" id="highDemandTypeDiv" style="display: none;">
                <label class="layui-form-label layui-required">紧俏座位处理:</label>
                <div class="layui-input-block">
                    <input type="radio" name="highDemandType" lay-filter="highDemandType" value="不处理" title="不处理" @if($policy['detail']['high_demand_type'] == '不处理') checked @endif>
                    <input type="radio" name="highDemandType" lay-filter="highDemandType" value="生 PNR" title="生pnr" @if($policy['detail']['high_demand_type'] == '生 PNR') checked @endif>
                    <input type="radio" name="highDemandType" lay-filter="highDemandType" value="禁售" title="禁售" @if($policy['detail']['high_demand_type'] == '禁售') checked @endif>
                </div>
                <div class="ant-form-explain">
                    必选，AV校验座位数低于阈值时兜底方式选择
                </div>
            </div>
            <div class="layui-form-item" id="highDemandThresholdDiv" style="display: none;">
                <label class="layui-form-label">紧俏座位阈值:</label>
                <div class="layui-input-inline"  style="width: 370px">
                    <input type="text" name="highDemandThreshold" value="{{$policy['detail']['high_demand_threshold']}}" lay-verify="" lay-reqText=""
                           placeholder="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" id="officeNoDiv">
                <label class="layui-form-label">搭桥office号:</label>
                <div class="layui-input-inline" style="width: 370px">
                    <input type="text" name="officeNo" value="{{$policy['detail']['office_no']}}" lay-verify="" lay-reqText="" placeholder=""
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否进行PAT: A校验:</label>
                <div class="layui-input-block">
                    <input type="radio" name="needPata" value="是" title="是" @if($policy['detail']['need_pata'] == '是') checked @endif>
                    <input type="radio" name="needPata" value="否" title="否" @if($policy['detail']['need_pata'] == '否') checked @endif>
                </div>
            </div>
        </div>
        <hr>
        <div class="split-text">退改信息</div>
        <div class="layui-form-item"></div>
        <div class="split-text split-text-returnChange">退改签规则:</div>
        <div class="piece">
            <div class="layui-form-item"></div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">退票:</label>
                    <div class="layui-input-inline" style="width: 280px">
                        <input type="text" id="returnRule" name="returnRule" value="{{$policy['detail']['return_rule']}}" lay-verify="returnRule" lay-reqText="" placeholder=""
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">改签:</label>
                    <div class="layui-input-inline" style="width: 280px">
                        <input type="text" id="changeRule" name="changeRule" value="{{$policy['detail']['change_rule']}}" lay-verify="changeRule" lay-reqText="" placeholder=""
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline" style="width: 200px;left: 100px">
                    <label class="layui-form-label signChange" id="endorsementDiv">是否允许签转:</label>
                    <div class="layui-input-inline" style="width: 80px">
                        <input type="checkbox" id="endorsement" name="endorsement" lay-filter="endorsement" value="是" @if($policy['detail']['endorsement'] == '是') checked @endif>
                    </div>
                </div>
            </div>

            <div class="ant-card ant-card-bordered" style="margin-left: 260px; width: 800px; margin-bottom: 32px; margin-top: 10px;height: 150px">
                <div class="ant-card-body" id="ReturnChangeText">
                    <br>
                    <br>
                    签转条件：不可签转
                </div>
            </div>
        </div>
        <hr>
        <div class="split-text">补充信息</div>
        <div class="layui-form-item"></div>
        <div class="piece">
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label layui-required">舱位说明:</label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入内容" rows="5" maxlength="255" class="layui-textarea" lay-verify="required" lay-reqText="舱位说明不能为空"
                              name="cabinNote" id="cabinNote">{{$policy['detail']['cabin_dec']}}</textarea>
                </div>
                <div class="ant-form-explain cabinDes" id="cabinDes">剩余255字符
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>

@endsection
@push('script')
    <script src="/static/js/qnpolicy/qn.js?version={{env('JS_VERSION')}}"></script>
    <script>
        layui.use(['form'], function () {

            var $ = layui.$
                , form = layui.form;

            //监听提交
            form.on('submit(*)', function (data) {

                $.ajax({
                    url: '/qnpolicy/ajaxUpdate'
                    , method: 'put'
                    , data: data.field
                    , dataType: 'json'
                    , success: function (data) {

                        layer.msg(data.errmsg, {
                            offset: '15px'
                            , icon: (data.errcode == 0 ? 1 : 5)
                            , time: 3000
                        }, function () {
                        });
                    },
                });

                return false;
            });

        })
    </script>
@endpush